<include file="public@header"/>
</head>
<body>
<div class="layui-fluid js-check-wrap">
    <div class="layui-card">
        <form method="post" class="js-ajax-form">
            <div class="layui-card-header well">
                <div class="layui-col-xs6">
                    <h3>所有数据</h3>
                </div>
                <div class="layui-col-xs6 text-right">
                    <a href="{:url('theme/fileArrayDataEdit',['tab'=>$tab,'var'=>$var,'file_id'=>$file_id,'widget'=>$widget])}" class="layui-btn layui-btn-normal">添加数据</a>
                </div>
            </div>
        
            <div class="layui-card-body">
                <table class="layui-table">
                    <thead>
                    <tr>
                        <foreach name="array_item" item="vo">
                            <th>{$vo.title}</th>
                        </foreach>
                        <th width="120">{:lang('ACTIONS')}</th>
                    </tr>
                    </thead>
                    <tbody>
                    <foreach name="array_items" item="item" key="itemKey">
                        <tr>
                            <foreach name="array_item" item="vo">
                                <td>
                                    <if condition="$vo['type'] eq 'image'">
                                        <a href="javascript:imagePreviewDialog('{:cmf_get_image_preview_url($item[$key])}');">
                                            <img src="{:cmf_get_image_preview_url($item[$key])}" width="150">
                                        </a>
                                    <else>
                                        {$item[$key]|default=''}
                                    </if>
                                </td>
                            </foreach>
                            <td>
                                <a href="{:url('theme/fileArrayDataEdit',['tab'=>$tab,'var'=>$var,'file_id'=>$file_id,'widget'=>$widget,'item_index'=>$itemKey])}" class="layui-btn layui-btn-xs">编辑</a>
                                <a href="{:url('theme/fileArrayDataDelete',['tab'=>$tab,'var'=>$var,'file_id'=>$file_id,'widget'=>$widget,'item_index'=>$itemKey])}"
                                   class="js-ajax-delete layui-btn layui-btn-danger layui-btn-xs">删除</a>
                            </td>
                        </tr>
                    </foreach>
                    </tbody>
                </table>
            </div>
        </form>
    </div>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
    function confirm() {
        return true;
    }
</script>
</body>
</html>
